package com.dreamteam.schooling.timetable;

import com.dreamteam.schooling.R;
import com.dreamteam.schooling.R.dimen;

import android.content.Context;
import android.widget.TextView;

public class TimetableItemView extends TextView {
	public static final int MONDAY = 1;
	public static final int TUESDAY = 2;
	public static final int WEDNESAY = 3;
	public static final int THURSDAY = 4;
	public static final int FRIDAY = 5;
	
	private int startTime;
	private int endTime;
	private int height;
	private int day;

	public TimetableItemView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
		height = context.getResources().getDimensionPixelSize(R.dimen.timeitem_height);
	}
	
	public void setDay(int day) {
		this.day = day;
	}

	public void setTime(int startTime, int endTime) {
		this.startTime = startTime;
		this.endTime = endTime;
		this.getLayoutParams().height = calHeight(startTime, endTime);
		System.out.println("height = " + this.getLayoutParams().height);
	}

	private int calHeight(int start, int end) {
		return (end-start)*height;
	}
	
	public int getDay() {
		return day;
	}
	
	public int getSize() {
		return height;
	}

	public int getStartTime() {
		return startTime;
	}

	public int getEndTime() {
		return endTime;
	}
}
